import request from '@/utils/request'

// 报表接口
export const reportApi = {
  // 业务报表接口
  // 获取业务统计概览数据
  getBusinessStats(params) {
    return request({
      url: '/report/business/stats',
      method: 'get',
      params
    })
  },
  
  // 获取业务图表数据
  getBusinessCharts(params) {
    return request({
      url: '/report/business/charts',
      method: 'get',
      params
    })
  },
  
  // 获取业务明细列表
  getBusinessList(params) {
    return request({
      url: '/report/business/list',
      method: 'get',
      params
    })
  },
  
  // 导出业务报表数据
  exportBusinessReport(data) {
    return request({
      url: '/report/business/export',
      method: 'post',
      responseType: 'blob',
      data
    })
  },
  
  // 贷款报表接口
  // 获取贷款统计概览数据
  getLoanStats(params) {
    return request({
      url: '/report/loan/stats',
      method: 'get',
      params
    })
  },
  
  // 获取贷款图表数据
  getLoanCharts(params) {
    return request({
      url: '/report/loan/charts',
      method: 'get',
      params
    })
  },
  
  // 获取贷款明细列表
  getLoanList(params) {
    return request({
      url: '/report/loan/list',
      method: 'get',
      params
    })
  },
  
  // 导出贷款报表数据
  exportLoanReport(data) {
    return request({
      url: '/report/loan/export',
      method: 'post',
      responseType: 'blob',
      data
    })
  },
  
  // 风险报表接口
  // 获取风险统计概览数据
  getRiskStats(params) {
    return request({
      url: '/report/risk/stats',
      method: 'get',
      params
    })
  },
  
  // 获取风险图表数据
  getRiskCharts(params) {
    return request({
      url: '/report/risk/charts',
      method: 'get',
      params
    })
  },
  
  // 获取风险明细列表
  getRiskList(params) {
    return request({
      url: '/report/risk/list',
      method: 'get',
      params
    })
  },
  
  // 导出风险报表数据
  exportRiskReport(data) {
    return request({
      url: '/report/risk/export',
      method: 'post',
      responseType: 'blob',
      data
    })
  },
  
  // 获取逾期统计数据
  getRiskOverdueStats(params) {
    return request({
      url: '/report/risk/overdue-stats',
      method: 'get',
      params
    })
  },
  
  // 放款报表接口
  // 获取放款统计概览数据
  getLendingStats(params) {
    return request({
      url: '/report/lending/stats',
      method: 'get',
      params
    })
  },
  
  // 获取放款图表数据
  getLendingCharts(params) {
    return request({
      url: '/report/lending/charts',
      method: 'get',
      params
    })
  },
  
  // 获取放款明细列表
  getLendingList(params) {
    return request({
      url: '/report/lending/list',
      method: 'get',
      params
    })
  },
  
  // 导出放款报表数据
  exportLendingReport(data) {
    return request({
      url: '/report/lending/export',
      method: 'post',
      responseType: 'blob',
      data
    })
  },
  
  // 获取放款失败分析
  getLendingFailureAnalysis(params) {
    return request({
      url: '/report/lending/failure-analysis',
      method: 'get',
      params
    })
  },
  
  // 获取放款效率分析
  getLendingEfficiency(params) {
    return request({
      url: '/report/lending/efficiency',
      method: 'get',
      params
    })
  }
} 